package com.snimay.app.role;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.google.gson.Gson;
import com.snimay.app.role.repository.RoleRepository;
import com.snimay.app.role.vo.Role;
import com.snimay.common.RestServiceController;
import com.snimay.util.ToWeb;

/**   
 * @Title      : RoleController.java
 * @Package    : com.snimay.app.role
 * @Description: 角色控制 
 * @author     : xxy
 * @date       : 2018年5月7日 下午4:23:09
 * @version    : V1.0   
 */
@RestController
@RequestMapping("role")
public class RoleController  implements RestServiceController<Role,Long>{
	@Autowired
	RoleRepository repository;
	@Override
	@GetMapping("/")
	public Object getOne(Long id) {
		// TODO Auto-generated method stub
		return null;
	}
	@GetMapping("/{name}")
	public Object getList() {
		ToWeb toweb = new ToWeb();
		toweb.setObjData(repository.findAll());
		return new Gson().toJson(toweb);
	}
	@Override
	public Object getList(Integer rowSize, Integer page) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Object postOne(Role entity) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Object putOne(Long id, Role entity) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Object patchOne(Long id, Role entity) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Object deleteOne(Long id) {
		// TODO Auto-generated method stub
		return null;
	}

}
